<?php
/**
  * 评论模型
  */
class CommentModel extends Model
{
   	// 验证设置
   	protected $_validate	 =	 array(
		array('username','require','昵称必须',self::MODEL_BOTH),
		array('content','require','评论内容必须',self::MODEL_BOTH)
		);

   	protected $_auto=array(
		array('add_time','time',self::MODEL_INSERT,'function'),
		array('ip_address','callbackIpAddress',self::MODEL_INSERT,'callback')
		);

	protected function callbackIpAddress()
	{
	  return get_client_ip();
	}  

}
?>